import App from "../App"
import Arrroute from "./config"
import { BrowserRouter as Router, Switch, Route, useHistory } from "react-router-dom"
const BasicRoute = () => {
    return (
        <Router History={useHistory}>
            <Switch>
                <Route path="/" component={() => {
                    return (
                        <App>
                            <Switch>
                                {
                                    Arrroute.map((item, index) => {
                                        return <Route key={index} exact path={item.pathname} component={item.component}></Route>
                                    })
                                }
                            </Switch>
                        </App>
                    )
                }}>
                </Route>
            </Switch>
        </Router>
    )
}

export default BasicRoute